package android.slc.appdb.sys.enums;

/**
 * @Description:
 * @Author: sunlunchang
 * @CreateDate: 2021/8/13 14:02
 */
public enum EnableEnum implements IDictEnum {
    ENABLE(0, "启用"),

    DISABLED(1, "禁用");

    private final int value;
    private final String label;

    EnableEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }


    public static int getValueByEnable(boolean enable) {
        if (enable) {
            return ENABLE.getValue();
        } else {
            return DISABLED.getValue();
        }
    }

    public static boolean getEnableByValue(Integer value) {
        return value == ENABLE.getValue();
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }
}
